home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / U-Utilities / (c)u1.d64 / 64 renumber.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  393b  |  18 lines

  1. 30000 REM*30000* RENUMBER RTN
  2. 30005 X=2049:Y=10:IN=10
  3. 30010 X1=PEEK(X+4):X2=PEEK(X+5)
  4. 30020 IF X1<>143 OR X2<>42 GOTO 30100
  5. 30030 X1=X+6:X2=0
  6. 30040 X3=PEEK(X1)
  7. 30050 IF X3=42 THEN 30090
  8. 30060 X3=X3-48
  9. 30070 IF X3<0 OR X3>9 THEN PRINT "ERR1":GOTO 30100
  10. 30080 X2=X2*10+X3:X1=X1+1:GOTO 30040
  11. 30090 IF Y<X2 THEN Y=X2:IN=10
  12. 30100 Y2=INT(Y/256):Y1=Y-Y2*256
  13. 30110 POKE X+2,Y1:POKE X+3,Y2:Y=Y+IN
  14. 30120 X=PEEK(X)+256*PEEK(X+1)
  15. 30130 Z=PEEK(X+2)+256*PEEK(X+3)
  16. 30140 IF Z<30000 THEN 30010
  17. 30150 END
  18.